package com.smart.support.controller;

import com.smart.common.entities.ajax.AjaxResult;
import com.smart.common.entities.constant.SmartConstant;
import com.smart.common.entities.option.SelectOption;
import com.smart.manager.product.repository.BasicPigstyRepository;
import com.smart.manager.work.repository.BasicStaffRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author leo
 * @date 2023/09/06
 */
@Api(tags = "工单系统公共资源")
@RestController
@RequestMapping(SmartConstant.MANAGER_API_PREFIX + "work/support")
@RequiredArgsConstructor
public class WorkApi {

    private final BasicStaffRepository basicStaffRepository;

    @ApiOperation(value = "管家数据字段")
    @GetMapping("basicStaffOptions")
    public AjaxResult<List<SelectOption>> basicStaffOptions() {
        List<SelectOption> result = basicStaffRepository.getOptions();
        return AjaxResult.data(result);
    }

    @ApiOperation(value = "管家ID数据字段")
    @GetMapping("staffIdOptions")
    public AjaxResult<List<SelectOption>> staffIdOptions() {
        List<SelectOption> result = basicStaffRepository.getIdOptions();
        return AjaxResult.data(result);
    }



}
